﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using XbsWebAPI.Application.CampRoom.Dtos;
using XbsWebAPI.Application.CampRoom.HouseType;
using XbsWebAPI.Application.CampRoom.Room.Dtos;
using XbsWebAPI.Application.QueryModel;
using XbsWebAPI.EntityFrameworkCore.Entities;
using XbsWebAPI.EntityFrameworkCore.Entities.Enums;

namespace XbsWebAPI.Application
{
    /// <summary>
    /// 房型APP接口
    /// </summary>
    public interface IHouseTypeAppService
    {
        #region 房型管理

        /// <summary>
        /// 根据房型id访问第一页基础数据
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        ResultDto<GetHouseTypeBasicDto> GetHouseTypeBasicById(Guid id);

        public Task<ResultDto<string>> CreateHouseTypeAsync(HouseType model);

        public Task<ResultDto<Guid>> CreateHouseTypeBasicAsync(CreateHouseTypeBasicDto model);

        public ResultDto<HouseType> GetHouseTypeById(Guid id);

        public Task<ResultDto<Guid>> UpdateHouseTypeBasicAsync(EditHouseTypeBasicDto model);

        /// <summary>
        /// 分页查询房型
        /// </summary>
        /// <param name="query">查询条件</param>
        /// <returns></returns>
        public ResultDto<PageListDto<ListHouseTypeDto>> GetHouseTypePagedList(QueryHouseType query);

        /// <summary>
        /// 上/下架 房型
        /// </summary>
        /// <param name="id">房型Id</param>
        /// <param name="status"></param>
        /// <returns></returns>
        Task<ResultDto<string>> TakeHouseTypeOnOff(Guid id, int status); 

        #endregion

        #region 节假日

        /// <summary>
        /// 节假日设置
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Task<ResultDto<string>> CreateHouseTypeHolidayAsync(CreateHouseTypeHolidayDto entity);

        /// <summary>
        /// 节假日 编辑
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Task<ResultDto<string>> UpdateHouseTypeHolidayAsync(EditHouseTypeHolidayDto entity);

        /// <summary>
        /// 节假日 列表
        /// </summary>
        /// <param name="campId">房型Id</param>
        /// <param name="seasonStatus">淡旺季 0-淡季，1-旺季</param>
        /// <returns></returns>
        ResultDto<List<ListHouseTypeHolidayDto>> GetListHouseTypeHolidays(Guid campId, SeasonStatus seasonStatus);

        /// <summary>
        /// 查询单个节假日信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        ResultDto<GetHouseTypeHolidayDto> GetHouseTypeHoliday(Guid id);

        /// <summary>
        /// 删除节假日信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<ResultDto<string>> RemoveHouseTypeHolidayAsync(Guid id);

        #endregion

        #region 特殊日

        /// <summary>
        /// 查询单个特殊日
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        ResultDto<GetHouseTypeSpecialDayDto> GetHouseTypeSpecialDay(Guid id);

        /// <summary>
        /// 查询对应房型特殊日类型
        /// </summary>
        /// <param name="houseTypeId"></param>
        /// <param name="seasonStatus"></param>
        /// <returns></returns>
        ResultDto<List<ListHouseTypeSpecialDayDto>> GetListHouseTypeSpecialDays(Guid houseTypeId, SeasonStatus seasonStatus);

        /// <summary>
        /// 设置特殊日信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        Task<ResultDto<string>> CreateHouseTypeSpecialDayAsync(CreateHouseTypeSpecialDayDto model);

        /// <summary>
        /// 更新特殊日信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        Task<ResultDto<string>> UpdateHouseTypeSpecialDayAsync(EditHouseTypeSpecialDayDto model);

        /// <summary>
        /// 删除特殊日信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<ResultDto<string>> RemoveHouseTypeSpecialDayAsync(Guid id);

        /// <summary>
        /// 获取房型第二页价格信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        ResultDto<HouseTypePriceDto> GetHouseTypePriceById(Guid id);
        
        /// <summary>
        /// 设置房型第二页的价格信息
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        Task<ResultDto<Guid>> SetHouseTypePriceAsync(HouseTypePriceDto model);

        /// <summary>
        /// 新建房间并绑定到当前房型（设置房型第三页）
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        Task<ResultDto<string>> AddBindRooms(CreateBindRoomDto model);

        /// <summary>
        /// 检测新增的房间是否与当前房型下的房间重名
        /// </summary>
        /// <param name="name"></param>
        /// <param name="houseTypeId"></param>
        /// <returns></returns>
        ResultDto<string> CheckRoomExisted(string name, Guid houseTypeId);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>

        ResultDto<List<GetRoomDto>> FindRoomsByHouseTypeId(Guid id);

        ResultDto<decimal> FindHouseTypeIdPriceFromDate(DateTime selectDate, Guid houseTypeId);
        Task<ResultDto<string>> RemoveHouseTypeById(Guid id);


        #endregion
    }
}
